import axios from '@/libs/api.request'

const USER = '/api/user'
const login = data => {
  return axios.request({
    url: `${USER}/signin`,
    data,
    method: 'post'
  })
}

const signup = data => {
  return axios.request({
    url: `${USER}/signup`,
    data,
    method: 'post'
  })
}

const signout = () => {
  return axios.request({
    url: `${USER}/signout`,
    method: 'get'
  })
}

const getUserInfo = () => {
  return axios.request({
    url: `${USER}/getUserInfo`,
    method: 'get'
  })
}

export default {
  login,
  signup,
  signout,
  getUserInfo
}
